-- GENERATED SPELL FOR [Sunfury Magister] --


function spell0_18855(pUnit, Event) --@Bloodcrystal Surge,Self--
pUnit:FullCastSpellOnTarget(35778,pUnit)
pUnit:RegisterEvent('Sorts_18855', 20338, 1)
end

function spell1_18855(pUnit, Event) --@Fireball,n/a--
pUnit:FullCastSpellOnTarget(9053,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_18855', 3000, 1)
end

function Sorts_18855(pUnit, Event)
local choix_sorts_18855 = math.random(0, 1)
if choix_sorts_18855 == 0 then
pUnit:RegisterEvent('spell0_18855', 1, 1)
end
if choix_sorts_18855 == 1 then
pUnit:RegisterEvent('spell1_18855', 1, 1)
end
end

function mob18855_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_18855', math.random(1500, 3000), 1)
end

function mob18855_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob18855_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob18855_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(18855, 1, 'mob18855_Action')
RegisterUnitEvent(18855, 2, 'mob18855_Leave')
RegisterUnitEvent(18855, 3, 'mob18855_Kill')
RegisterUnitEvent(18855, 4, 'mob18855_Die')
